#pragma once

#include "DX11Includes.h"
#include "EngineStuff.h"
#include "Camera.h"
#include "InputLayouts.h";

class IObject;
class IHudElement;

union RenderableObject
{
	IObject* IOBJECT;
	IHudElement* IHUDELEMENT;
	void* OBJ;
};


class IShader
{
public:
	IShader(void);
	~IShader(void);
	virtual HRESULT Init(const char* effectName,const char* VsName, const char* vsVersion, const char* PsName,const char* psVersion, VertexLayout vl, const char* GsName = NULL,const char* GsVersion = NULL, D3D11_SO_DECLARATION_ENTRY declaration[] = NULL, int nElements = 0,UINT* stride = NULL, UINT numStrides = 0);	
	virtual void SetShaderOnDevice(RenderableObject obj );
	virtual void Update(RenderableObject obj, Camera* camera) {}
	virtual void UnsetShaderOnDevice(RenderableObject obj) {}

protected:
	ID3D11VertexShader*                 g_pVertexShader ;
	ID3D11PixelShader*                  g_pPixelShader ;
	ID3D11GeometryShader*				g_pGeometricShader;

	ID3D11InputLayout*                  g_pVertexLayout ;
	HRESULT CompileShaderFromFile( const char* szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut );

};
